package com.itheima.a01mathdemo;

public class MathDemo5 {
    public static void main(String[] args) {
        //统计一共有多少个四叶玫瑰数
        int count = 0;
        for (int i = 1000; i < 10000; i++) {
            int sum = 0;
            int tmp = i;
            while (tmp != 0) {
                sum += Math.pow(tmp % 10, 4);
                tmp /= 10;
            }
            if (sum == i) {
                count++;
            }
        }
        System.out.println(count);
    }
}
